"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
const fs = __importStar(require("fs"));
const path_1 = __importDefault(require("path"));
const vue_1 = require("vue");
const lodash_1 = require("lodash");
const lib_css_1 = __importDefault(require("../../../../../../../@libs/nodejs-lib-main/lib_css"));
const upload_role_pic_1 = __importDefault(require("../../../OtherCompoents/upload_role_pic/upload_role_pic"));
const global_1 = require("../../../../../config/global");
const icons_vue_1 = require("@element-plus/icons-vue");
const component = {
    components: { UploadPic: upload_role_pic_1.default, Location, CircleCloseFilled: icons_vue_1.CircleCloseFilled },
    name: 'role_describe',
    props: {
        currentRole: global_1.role,
        changePanelIndex: null,
        nodeData: Object,
        lf: Object || String
    },
    template: fs.readFileSync(`${__dirname}/role_describe.html`, "utf-8"),
    methods: {
        closePanel() {
            this.$emit('changePanel', 1);
        },
        saveRoleInfo() {
            console.log("保存", this.$props.currentRole);
            this.$emit('saveRoleInfo', this.$props.currentRole);
            this.$data.role_picUrl = (0, lodash_1.cloneDeep)(this.$props.currentRole.role_picUrl);
            console.log("this.$data.role_picUrl", this.$data.role_picUrl);
            this.$data.role_name = (0, lodash_1.cloneDeep)(this.$props.currentRole.role_name);
            this.$emit('changePanel', 1);
        },
        savePic(picName) {
            this.$props.currentRole.role_picUrl = picName;
        }
    },
    data() {
        return {
            role_picUrl: '',
            role_name: '',
            // role_id: ref(''),//外部角色id
            // role_desc: ref(''),//角色说明
            // role_others: ref(''),//角色其他
            visible: (0, vue_1.ref)(true),
        };
    },
    watch: {},
    created() {
    },
    setup() {
    },
    onMounted() {
    },
    mounted() {
        // this.openRoleDesc()
        lib_css_1.default.load([
            {
                parent: this.$el,
                url_s: path_1.default.join(`${__dirname}/role_describe.css`),
            },
        ]);
    },
};
module.exports = component;
